<?php
require(dirname(__FILE__) . '/includes/init.php');
if($_REQUEST['act'] == 'view'){
	$start_ye = $_GET['start_ye'];
	$end_ye = $_GET['end_ye'];
	$provider = $_GET['provider'];
	$addtime = $_GET['add_time'];
    $start_rank = ($start_ye-1)*36;
	$end_rank = $end_ye*36+1;
	$sql = "select * from ".$ecs->table('jingdong')." where add_time='".$addtime."' and ranking>".$start_rank." and ranking<".$end_rank." and provider='".$provider."'";
	//echo $sql;exit;
	$goods_list = $db->getAll($sql);
	foreach($goods_list as $i=>$goods){
		$goods_list[$i]['ye_num'] = (int)(($goods['ranking']-1)/36+1);
		$goods_list[$i]['add_time'] = date('Y-m-d H:i:s',$goods['add_time']);
		if($goods['commentcount']!=0){
			$goods_list[$i]['good_count_lv'] = number_format($goods['goodcount']/$goods['commentcount']*100,2).'%';
		}else{
			$goods_list[$i]['good_count_lv'] = '0.00%';
		}
	}
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>管理中心 - 产品详情 </title>
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/general.css" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
 
<h1>
<span class="action-span"><a href="javascript:void(0)" onclick="history.go(-1)">回到历史记录</a></span>
<span class="action-span1"><a target="_top" href="index.php?act=main">管理中心</a> </span><span id="search_id" class="action-span1"> - 产品详情 </span>
<div style="clear:both"></div>
</h1>
<!-- 订单列表 -->
<div class="list-div" id="listDiv">
<table cellpadding="3" cellspacing="1">
  <tr>
    <th>排名</th>
	<th>SKU</th>
	<th>产品名</th>
    <th>所在页</th>
    <th>评价总数</th>
    <th>好评数</th>
    <th>中评数</th>
    <th>差评数</th>
	<th>好评率</th>
	<th>时间</th>
  <tr>
  <?php 
    $i=0;
	if(count($goods_list)>0){
	foreach($goods_list AS $index => $array_val){
  ?>
   <tr>
    <td><?php echo $array_val['ranking'];?></td>
	<td><?php echo $array_val['products_sn'];?></td>
    <td><a href="http://www.360buy.com/product/<?php echo $array_val['products_sn'];?>.html" target="_blank"><?php echo $array_val['products_name'];?></a></td>
    <td><?php echo $array_val['ye_num'];?></td>
    <td><?php echo $array_val['commentcount'];?></td>
    <td><?php echo $array_val['goodcount'];?></td>
    <td><?php echo $array_val['generalcount'];?></td>
    <td><?php echo $array_val['poorcount'];?></td>
	<td><?php echo $array_val['good_count_lv'];?></td>
	<td><?php echo $array_val['add_time'];?></td>
  <tr>
  <?php 
      } 
	}
  ?>
  </table>
  </div>
</body>
</html>